<template>
  <div>
    <table>
        <tr>
            <th>编号</th>
            <th>名称</th>
            <th>班级</th>
        </tr>
        <tr v-for="(i ,index) in clist" :key="index">
            <td>{{i.id}}</td>
            <td>{{i.name}}</td>
            <td>{{i.number}}</td>

        </tr>
    </table>
    <el-pagination
  background
  layout="prev, pager, next"
  :total="total"
  @current-change="change"
  :page-size = 'page_size'>
</el-pagination>
  </div>
</template>

<script>
export default {
    data(){
        return{
            page:1,
            total:0,
            page_size:0,
            clist:[]
        }
    },
    methods: {
        getStu(){
            this.axios.get('user/student?page='+this.page).then((res) => {
                this.clist = res.data.clist
                this.total = res.data.total
                this.page_size = res.data.page_size
            })
        },
        change(number) {
            alert(number);
            this.page = number;
            this.getStu();
        },
    },
    mounted(){
        this.getStu()
    }

}
</script>

<style>

</style>